<template>
  <p>
    每次增加1：<button @click="increment">+</button>
    数字：{{ add }}
  </p>
  <p>
    每次减少1：<button @click="reduction">-</button>
    数字：{{ reduce }}
  </p>
</template>

<script setup>
import { useStore } from './store'
import { storeToRefs } from 'pinia'
const store = useStore()
const { add, reduce } = storeToRefs(store)
const increment = () => {
  store.increase()
 }
const reduction = () => {
  store.decrease()
 }
</script>

<style>
button {
  background-color: aquamarine;
}
</style>
